#lang scheme/gui
(require "utils.scm")
(provide state%)

(define state%
  (class object%
         (define R 25)
         (define UNHIGHLIGHTED (make-object color% "black"))
         (define HIGHLIGHTED (make-object color% "red"))

         (init-field (name " ") (x R) (y R))
         (define szName name)
         (define history '())
         (define curColor UNHIGHLIGHTED)
         (define transitions '())

         (define/public (move new-x new-y)
           (set! x new-x)
           (set! y new-y))

         (define/public (get-x) x)

         (define/public (get-y) y)

         (define/public (highlight)
           (set! curColor HIGHLIGHTED))

         (define/public (unhighlight)
           (set! curColor UNHIGHLIGHTED))

         (define/public (get-color)
           curColor)

         (define/public (get-name)
           szName)

         (define/public (set-name name)
           (set! szName name))

         (define/public (clear-history)
           (set! history '()))

         (define/public (consume-input symbol)
           (cons-last! symbol history))

         (define/public (get-history) history)

         (define/public (set-history h) (set! history h))

         (super-new)))
